% this function is used for merging the 'r0m(m=1,2,...)' into 'r0'
function r0 = r0m_merge(r0m)
% r0m: r0 for each layer of phase screen
% r0: the total Fried number caused by atmosphere

r0 = (sum((r0m.^(-5/3))))^(-3/5);

% end of the function
end

% Testing code
%r0m = zeros(1,layers);
%for i = 1: layers
%    r0m(i) = r0_generate(Cn2,lenbda,H_m(i),H_m(i+1));
%end
